package com.ruoyi.labdata.domain;

import java.util.Date;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import cn.hutool.core.util.ObjectUtil;


/**
 * 二维码对象 lab_two_dimensional_code
 * 
 * @author lzlong
 * @date 2022-03-07
 */
public class LabTwoDimensionalCode extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键id */
    private Long id;

    /** 二维码编码 */
    @Excel(name = "二维码编码")
    private String code;

    /** 文件路径 */
    @Excel(name = "文件路径")
    private String filePath;

    /** 颜色 */
    @Excel(name = "颜色(0-红色 ,1-蓝色 ,2-黑色")
    private String color;

    /** 是否导出( 0-未导出 1-导出) */
    @Excel(name = "是否导出( 0-未导出 1-导出)")
    private String isExport;

    /** 是否绑定物体(0-未绑定 1-绑定) */
    @Excel(name = "是否绑定物体(0-未绑定 1-绑定)")
    private String isBinding;

    /** 绑定物品名称 */
    @Excel(name = "绑定物品名称")
    private String bingGoodsName;

    /** 绑定时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "绑定时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date bingdingTime;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdTime;

    /** 创建人 */
    @Excel(name = "创建人")
    private String createdBy;

    /**
     * 二维码生成数量
     */
    private Integer codeNumber;

    /**
     * 条码起始位
     */
    private String codePre;

    /**
     * 条码中间位生成规则
     */
    private String codeMiddleRule;

    /**
     * 条码中间位包含内容
     */
    private String[] codeMiddleContent;

    /**
     * 条码结束位生成规则
     */
    private String codeEndRule;

    /**
     * 条码结束位包含内容
     */
    private String[] codeEndContent;

    /**
     * 加密类型
     */
    private String encryptionType;


    public String getCodePre() {
        return codePre;
    }

    public void setCodePre(String codePre) {
        this.codePre = codePre;
    }

    public String getCodeMiddleRule() {
        return codeMiddleRule;
    }

    public void setCodeMiddleRule(String codeMiddleRule) {
        this.codeMiddleRule = codeMiddleRule;
    }

    public String getCodeMiddleContent() {
        int length = 0;
        if (ObjectUtil.isNotEmpty(codeMiddleContent)){
             length = codeMiddleContent.length;
        }
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < length; i++) {
            stringBuilder.append(codeMiddleContent[i]);
        }
        return stringBuilder.toString();
    }

    public void setCodeMiddleContent(String[] codeMiddleContent) {
        this.codeMiddleContent = codeMiddleContent;
    }

    public String getCodeEndContent() {
        int length = 0;
        if (ObjectUtil.isNotEmpty(codeEndContent)){
            length = codeEndContent.length;
        }
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < length; i++) {
            stringBuilder.append(codeEndContent[i]);
        }
        return stringBuilder.toString();
    }

    public void setCodeEndContent(String[] codeEndContent) {
        this.codeEndContent = codeEndContent;
    }

    public String getCodeEndRule() {
        return codeEndRule;
    }

    public void setCodeEndRule(String codeEndRule) {
        this.codeEndRule = codeEndRule;
    }



    public String getEncryptionType() {
        return encryptionType;
    }

    public void setEncryptionType(String encryptionType) {
        this.encryptionType = encryptionType;
    }

    public Integer getCodeNumber() {
        return codeNumber;
    }

    public void setCodeNumber(Integer codeNumber) {
        this.codeNumber = codeNumber;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setCode(String code) 
    {
        this.code = code;
    }

    public String getCode() 
    {
        return code;
    }
    public void setFilePath(String filePath) 
    {
        this.filePath = filePath;
    }

    public String getFilePath() 
    {
        return filePath;
    }
    public void setColor(String color) 
    {
        this.color = color;
    }

    public String getColor() 
    {
        return color;
    }
    public void setIsExport(String isExport) 
    {
        this.isExport = isExport;
    }

    public String getIsExport() 
    {
        return isExport;
    }
    public void setIsBinding(String isBinding) 
    {
        this.isBinding = isBinding;
    }

    public String getIsBinding() 
    {
        return isBinding;
    }
    public void setBingGoodsName(String bingGoodsName) 
    {
        this.bingGoodsName = bingGoodsName;
    }

    public String getBingGoodsName() 
    {
        return bingGoodsName;
    }
    public void setBingdingTime(Date bingdingTime)
    {
        this.bingdingTime = bingdingTime;
    }

    public Date getBingdingTime()
    {
        return bingdingTime;
    }
    public void setCreatedTime(Date createdTime) 
    {
        this.createdTime = createdTime;
    }

    public Date getCreatedTime() 
    {
        return createdTime;
    }
    public void setCreatedBy(String createdBy) 
    {
        this.createdBy = createdBy;
    }

    public String getCreatedBy() 
    {
        return createdBy;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("code", getCode())
            .append("filePath", getFilePath())
            .append("color", getColor())
            .append("isExport", getIsExport())
            .append("isBinding", getIsBinding())
            .append("bingGoodsName", getBingGoodsName())
            .append("bingdingTime", getBingdingTime())
            .append("remark", getRemark())
            .append("createdTime", getCreatedTime())
            .append("createdBy", getCreatedBy())
            .toString();
    }
}
